﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Text;

using XCode;
using BingZi.HY.Core;

namespace BingZi.HY.Core
{
	/// <summary>
	/// 用户角色表
	/// </summary>
	[Serializable]
	[DataObject]
	[Description("用户角色表")]
	[BindTable("sys_UserRoles", Description = "用户角色表", ConnName = "System")]
	public partial class sys_UserRoles
	{
		#region 属性

        private Int32 _R_ID = 0;
        /// <summary>
        /// 编号
        /// </summary>
        [Description("编号")]
        [DataObjectField(true, true, false, 10)]
        [BindColumn(1, "R_ID", "编号", "", "int", 10, 0, false)]
        public Int32 R_ID
        {
            get { return _R_ID; }
            set { if (OnPropertyChanging("R_ID", value)) _R_ID = value; }
        }


		private Int32 _R_UserID;
		/// <summary>
		/// 用户ID与sys_User表中UserID相关
		/// </summary>
		[Description("用户ID与sys_User表中UserID相关")]
        [DataObjectField(false, false, false, 10)]
		[BindColumn(1, "R_UserID", "用户ID与sys_User表中UserID相关", "", "int", 10, 0, false)]
		public Int32 R_UserID
		{
			get { return _R_UserID; }
			set { if (OnPropertyChanging("R_UserID", value)) { _R_UserID = value;   } }
		}

		private Int32 _R_RoleID;
		/// <summary>
		/// 用户所属角色ID与Sys_Roles关联
		/// </summary>
		[Description("用户所属角色ID与Sys_Roles关联")]
        [DataObjectField(false, false, false, 10)]
		[BindColumn(2, "R_RoleID", "用户所属角色ID与Sys_Roles关联", "", "int", 10, 0, false)]
		public Int32 R_RoleID
		{
			get { return _R_RoleID; }
			set { if (OnPropertyChanging("R_RoleID", value)) { _R_RoleID = value;   } }
		}
		#endregion

		#region 获取/设置 字段值
		/// <summary>
		/// 获取/设置 字段值。
		/// 一个索引，基类使用反射实现。
		/// 派生实体类可重写该索引，以避免反射带来的性能损耗
		/// </summary>
		/// <param name="name">字段名</param>
		/// <returns></returns>
		public override Object this[String name]
		{
			get
			{
				switch (name)
				{
                    case "R_ID": return _R_ID;
					case "R_UserID" : return _R_UserID;
					case "R_RoleID" : return _R_RoleID;
					default: return base[name];
				}
			}
			set
			{
				switch (name)
				{
                    case "R_ID": _R_ID = Convert.ToInt32(value); break;
					case "R_UserID" : _R_UserID = Convert.ToInt32(value); break;
					case "R_RoleID" : _R_RoleID = Convert.ToInt32(value); break;
					default: base[name] = value; break;
				}
			}
		}
		#endregion

		#region 字段名
		/// <summary>
		/// 取得用户角色表字段名的快捷方式
		/// </summary>
        [CLSCompliant(false)]
		public class _
		{
            ///<summary>
            /// 编号
            ///</summary>
            public const String R_ID = "R_ID";

			///<summary>
			/// 用户ID与sys_User表中UserID相关
			///</summary>
			public const String R_UserID = "R_UserID";

			///<summary>
			/// 用户所属角色ID与Sys_Roles关联
			///</summary>
			public const String R_RoleID = "R_RoleID";
		}
		#endregion
	}
}